<template>
  <Wmodule title="孢子监测仪信息" class="m5">
    <div class="list">
      <div class="item" v-for="(item, index) in list" :key="index">
        <div class="img-box">
          <div class="name-box">
            <div class="name1">{{ item.statusLabel }}</div>
          </div>
          <div class="item-value">{{ item.status }}</div>
        </div>
      </div>
    </div>
  </Wmodule>
</template>
<script setup>
import { ref, watch, toRaw } from 'vue'
import Wmodule from '@/components/wmodule/index.vue'

const props = defineProps({
  data: {
    type: Array,
    default: () => []
  }
})

const list = ref([])

watch(
  () => props.data,
  (newVal) => {
    const _newVal = toRaw(newVal)
    list.value = _newVal
  }
)
</script>
<style lang="scss" scoped>
.m5 {
  height: 100%;
}
.list {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 1fr 1fr;
  grid-row-gap: 40px;
  .item {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .img-box {
    width: 130px;
    height: 71px;
    position: relative;
    background: url('@/assets/img/39.gif') no-repeat center;
    background-size: contain;
    .name-box {
      position: absolute;
      width: 86px;
      height: 28px;
      right: 6px;
      top: 2px;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      .name1 {
        overflow: hidden;
        font-family: PingFang SC;
        font-weight: 500;
        font-size: 14px;
        color: white;
        text-align: center;
      }
    }
    .item-value {
      position: absolute;
      right: 6px;
      bottom: 2px;
      width: 86px;
      height: 30px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: Source Han Sans CN;
      font-weight: bold;
      font-size: 16px;
      color: #1c3c39;
    }
  }
}
</style>
